<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
   
  <meta name="keywords" content="不矜，不伐，不自是" />
   
  <meta name="description" content="无名之辈" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    USB转串口（485/422/TTL-UART/232）设计-补充 |  晓康的博客
  </title>
  <meta name="generator" content="hexo-theme-yilia-plus">
  
  <link rel="shortcut icon" href="/favicon.ico" />
  
  
<link rel="stylesheet" href="/css/style.css">

  
<script src="/js/pace.min.js"></script>


  

  

<link rel="alternate" href="/atom.xml" title="晓康的博客" type="application/atom+xml">
</head>

</html>

<body>
  <div id="app">
    <main class="content">
      <section class="outer">
  <article id="post-USB转串口（485-422-TTL-UART-232）设计-补充" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  USB转串口（485/422/TTL-UART/232）设计-补充
</h1>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/ck6r6m2c30004l0rhein12dbg/" class="article-date">
  <time datetime="2020-02-16T09:54:38.000Z" itemprop="datePublished">2020-02-16</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E7%A1%AC%E4%BB%B6/">硬件</a>
  </div>

      
      
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> 字数统计:</span>
            <span class="post-count">1.1k字</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> 阅读时长≈</span>
            <span class="post-count">4分钟</span>
        </span>
    </span>
</div>

      
    </div>
    

    
    
    <div class="tocbot"></div>





    

    
    <div class="article-entry" itemprop="articleBody">
      


      

      
      <p>早先博客中发布了关于USB转串口的探讨性文章，USB转422这个小物件最后做出来了却一直没有整理总结，特在此写一篇纯干货的方案介绍文档，也是为了方便自己查阅吧。</p>
<p>原博客链接：<a href="https://blog.csdn.net/hxkrrzq/article/details/95981139" target="_blank" rel="noopener">最好的自己in</a></p>
<p>一直没有整理也是因为AD18挂掉一次，导致原理图所有器件标号消失了，最近重新审视那个电路，发现一些新的问题，在此一并探讨。</p>
<h2 id="1-硬件结构"><a href="#1-硬件结构" class="headerlink" title="1. 硬件结构"></a>1. 硬件结构</h2><p><img src="/2020/ck6r6m2c30004l0rhein12dbg/1581851521371.png" alt="1581851521371"></p>
<a id="more"></a>

<p>虽然是个小物件，画得详细点倒也不少。虚框画出的5个小部分我想大部分的接口模块都应该类似。</p>
<h2 id="2-各部分电路详解"><a href="#2-各部分电路详解" class="headerlink" title="2. 各部分电路详解"></a>2. 各部分电路详解</h2><ol>
<li>隔离保护，信号和电源均需隔离，电路和Layout必须考虑</li>
</ol>
<ol start="2">
<li>接口保护，包括静电、浪涌、限流、防雷、接地等相关内容</li>
</ol>
<ol start="3">
<li><p>电源切换电路，虽说不必要，就当练练吧</p>
<p>滞回比较器控制选通MOS管</p>
</li>
</ol>
<ol start="4">
<li>先看一下485芯片的外围电路</li>
</ol>
<p>485芯片的引脚定义（以TI的SN65HVD82为例，其他类似芯片文档不全）：</p>
<p><img src="/2020/ck6r6m2c30004l0rhein12dbg/1581866222066.png" alt="1581866222066"></p>
<p> <img src="/2020/ck6r6m2c30004l0rhein12dbg/1581862249551.png" alt="1581862249551"></p>
<p>可知该类芯片由两组模块组成，收和发都是1输入1输出1控制信号，它们公用一组差分线A、B，优先分析图中方框中的非正常输入，可知：</p>
<ul>
<li>当A、B差分线开路、短路、处于空闲状态时，如果只做接收机，则接收端维持高电平。即AB线即使没有上下拉，R在上电初始也是高电平。</li>
<li>UART是通过下降沿脉冲来收发信号，最终总线是要回到高电平，可以视作高电平为常态，就是A高B低为常态，所以外部干扰大的时候，一般会给A加上拉，B加下拉，上下拉的强弱与通信速率、器件带载是一个平衡关系。又可查A或B的差模电压能达到12V，理论上上提高上拉电压到9V、12V也能增强抗干扰度。</li>
<li>OUTPUT列的？是必须要避免的，可知芯片本身做了保护性高电平输出，但是AB的上下拉会起到辅助作用。</li>
<li>422接口设计的时候，使用两片485芯片，一个单独收一个单独发，那么不使用的引脚如何处理？<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">a. 如果收发都不使能，都处于OPEN状态，AB线高阻态，那么对总线不会产生影响</span><br><span class="line">b. 如果【只收】，RE拉低，此时D和DE都是输入，由于DE是open，上图Table1第四行可知此时的D和DE关闭了发送器使AB呈现高阻状态，即控制权完全交给了接收器，之所以D\DE可以悬空，但是考虑到CMOS电路悬空可能导致抗扰度降低，以及可能会有电荷累积等等，最后结论是【D和DE都应下拉到地】</span><br><span class="line">c. 如果【只发】，DE拉高，Table2可知RE是拉高或者开路，R都是高阻态，所以【R作为输出，应当悬空】（相比而言拉到低反而不好），RE可以拉高也可以开路但是考虑到CMOS电路输入问题，【RE应当拉高】</span><br><span class="line">d. b、c分析结论：输出悬空，输入接地</span><br></pre></td></tr></table></figure>


</li>
</ul>
<ol start="5">
<li>再讨论下如何在电路上实现单个485芯片自动收发<br><img src="/2020/ck6r6m2c30004l0rhein12dbg/1581867267195.png" alt="1581867267195"></li>
</ol>
<p>DI接地，证明发送使能时候，AB线只能输出低电平。高电平是在接受使能时，上下拉使AB线输出高电平。因此这里又是一个上下拉的作用。</p>
<ol start="6">
<li>485、422、Uart的电气特性，如何在一块板子上同时实现Uart、485、422？</li>
</ol>
<ol start="7">
<li>USB转串口芯片选型，除了PL2303,CH430这些开发板必备之外还有很多……</li>
</ol>
<ol start="8">
<li>另外再复习下SolidWorks建模</li>
</ol>
<h2 id="3-烧录软件说明"><a href="#3-烧录软件说明" class="headerlink" title="3. 烧录软件说明"></a>3. 烧录软件说明</h2><p>FT230是可编程的，虽然大部分时候用不了，不过基于试练目的，本设计的power灯是需要编程配置之后才能正常工作。</p>
<h2 id="4-半年使用（测试）总结"><a href="#4-半年使用（测试）总结" class="headerlink" title="4. 半年使用（测试）总结"></a>4. 半年使用（测试）总结</h2><p>没有出现功能上的可见故障，但是有时会挑电脑的USB口。</p>
<p>插上外接电源未发现异常也未发现任何好处……（虽说原先测试宇泰收发器时外接供电可以明显提高抗干扰）</p>
<p>为了实现绝对的电平兼容能力，UART接口是不对外供电的，这让人头疼……我有隔离芯片干嘛不直接接出来……</p>
<p>很多时候都想精简它，使其小型化，最好比优盘小……</p>

      
      <!-- reward -->
      
      <div id="reward-btn">
        打赏
      </div>
      
    </div>
    
    
      <!-- copyright -->
      
        <div class="declare">
          <ul class="post-copyright">
            <li>
              <i class="ri-copyright-line"></i>
              <strong>版权声明： </strong s>
              本博客所有文章除特别声明外，均采用 <a href="https://www.apache.org/licenses/LICENSE-2.0.html" rel="external nofollow"
                target="_blank">Apache License 2.0</a> 许可协议。转载请注明出处！
            </li>
          </ul>
        </div>
        
    <footer class="article-footer">
      
          
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=https://an_kang.gitee.io/2020/ck6r6m2c30004l0rhein12dbg/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/USB2Uart/" rel="tag">USB2Uart</a></li></ul>


    </footer>

  </div>

  
  
  <nav class="article-nav">
    
      <a href="/2020/ck6r6m2cz000ll0rh8eb16sxx/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            《电气工程101》读书笔记
          
        </div>
      </a>
    
    
      <a href="/2020/ck6r6m2c00001l0rh02xrbyl8/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">MarkDown语法导致hexo页面生成BUG</div>
      </a>
    
  </nav>


  

  
  
<!-- valine评论 -->
<div id="vcomments-box">
    <div id="vcomments">
    </div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js'></script>
<script>
    new Valine({
        el: '#vcomments',
        app_id: 'JY6tekdhqfeJz8rALTVDemJ9-gzGzoHsz',
        app_key: 'DrBLLXiFYlEXJqYtDTbvvB5L',
        path: window.location.pathname,
        notify: 'true',
        verify: 'false',
        avatar: 'mp',
        placeholder: '给我的文章加点评论吧~',
        recordIP: true
    });
    const infoEle = document.querySelector('#vcomments .info');
    if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
        infoEle.childNodes.forEach(function (item) {
            item.parentNode.removeChild(item);
        });
    }
</script>
<style>
    #vcomments-box {
        padding: 5px 30px;
    }

    @media screen and (max-width: 800px) {
        #vcomments-box {
            padding: 5px 0px;
        }
    }

    #vcomments-box #vcomments {
        background-color: #fff;
    }

    .v .vlist .vcard .vh {
        padding-right: 20px;
    }

    .v .vlist .vcard {
        padding-left: 10px;
    }
</style>

  

  
  
  

</article>
</section>
      <footer class="footer">
  <div class="outer">
    <ul class="list-inline">
      <li>
        &copy;
        2019-2020
        an_kang
      </li>
      <li>
        
          Powered by
        
        
        <a href="https://hexo.io" target="_blank">Hexo</a> Theme <a href="https://github.com/Shen-Yu/hexo-theme-ayer" target="_blank">Ayer</a>
        
      </li>
    </ul>
    <ul class="list-inline">
      <li>
        
        
        <span>
  <i>PV:<span id="busuanzi_value_page_pv"></span></i>
  <i>UV:<span id="busuanzi_value_site_uv"></span></i>
</span>
        
      </li>
      <li>
        <!-- cnzz统计 -->
        
      </li>
    </ul>
  </div>
</footer>
    <div class="to_top">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>
      </div>
    </main>
      <aside class="sidebar">
        <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="晓康的博客"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/2020/about">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
      </aside>
      <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>吓着了吧，哈~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
      
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/jquery.justifiedGallery.min.js"></script>


<script src="/js/lazyload.min.js"></script>


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<script src="/js/share.js"></script>




<script>
  try {
    var typed = new Typed("#subtitle", {
    strings: ['学而不思则罔，思而不学则殆','',''],
    startDelay: 300,
    typeSpeed: 200,
    loop: true,
    backSpeed: 100,
    showCursor: true
    });
  } catch (err) {
  }
  
</script>




<script src="/js/tocbot.min.js"></script>

<script>
  // Tocbot_v4.7.0  http://tscanlin.github.io/tocbot/
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer:'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto',
    onClick: (e) => {
      $('.toc-link').removeClass('is-active-link');
      $(`a[href=${e.target.hash}]`).addClass('is-active-link');
      $(e.target.hash).scrollIntoView();
      return false;
    }
  });
</script>


<script>
  var ayerConfig = {
    mathjax: false
  }
</script>


<script src="/js/ayer.js"></script>


<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>




<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>
  </div>
</body>

</html>